# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pylab as pl
from sympy import *

x = Symbol('x')
y = Symbol('y')

func1 = (2e-01)*x + (1e-05)*x**2 + (7e-07)*x**3-y
func2 = 152.745531053 + 0.0293006968639*x + -5.94410661913e-05*x**2-y
#返回交点
def getcross(func1, func2):
    dict = solve([func1, func2],[x,y])
    point = filter1(dict)
    return point
#过滤
def filter1(dict):
    for num1 in dict:
        if len(num1) > 1:
            if str(num1[0]).find('I') == -1:
                if num1[0] > 0 and num1[0] < 1000:
                   return num1

#dict = solve([func1, func2],[x,y])
#print dict
#print dict[0]
#print dict[0][0]
#print len(str(dict[1][0]).split('-'))

point = getcross(func1,func2)
print point



